package service.Impl;

import dao.NewsDao;
import factory.AbstractFactory;
import factory.MySqlDaoFactory;
import factory.SimpleDaoFactory;
import pojo.News;

public class NewsServiceImplTest {
    public static void main(String[] args) {
//        NewsDao dao= SimpleDaoFactory.getInstance("mysql");
        AbstractFactory factory=new MySqlDaoFactory();
        NewsDao dao=factory.getInstance();
        NewsServiceImpl service=new NewsServiceImpl();
        service.setNewsDao(dao);

        News news=new News();
        news.setNtitle("测试标题2");
        news.setNcontent("测试内容2");
        service.addNews(news);
    }
}
